<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <div id="app">
    姓<input type="text" v-model="firstName">
    名<input type="text" v-model="lastName">

    <p>全名：{{getName1()}}</p>
    <p>全名：{{fullName}}</p>
    <h1>{{count}}</h1>
    <button @click="count++">+++</button>
  </div>
  <!-- 引入vue文件 -->
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        firstName: '',
        lastName: '',
        count: 0,
      },
      computed: {
        fullName() {
          console.log(8888)
          return this.firstName + '' + this.lastName;
        }
      },
      methods: {
        getName1() {
          console.log(666);
          return this.firstName + '' + this.lastName;
        }
      }
    })

  </script>
</body>

</html>